﻿using Learun.Application.TwoDevelopment.ZZDT_EC;
using Learun.Util;
using System.Collections.Generic;
using System.Data;
using System.Web.Mvc;

namespace Learun.Application.Web.Areas.ZZDT_EC.Controllers
{
    /// <summary>
    /// 版 本 PIT-ADMS V7.0.3 敏捷开发框架
    /// Copyright (c) 2013-2018 Hexagon PPM
    /// 创 建：超级管理员
    /// 日 期：2022-03-07 13:46
    /// 描 述：工程数据属性表
    /// </summary>
    public class ec_enginedata_propertyController : MvcControllerBase
    {
        private ec_enginedata_propertyIBLL ec_enginedata_propertyIBLL = new ec_enginedata_propertyBLL();

        #region 视图功能

        /// <summary>
        /// 主页面
        /// <summary>
        /// <returns></returns>
        [HttpGet]
        public ActionResult Index()
        {
             return View();
        }
        #endregion

        #region 获取数据

        /// <summary>
        /// 获取工程数据属性表数据
        /// <summary>
        /// <param name="EngineDataID">工程数据ID</param>
        /// <param name="ProjectId">项目ID</param>
        /// <returns></returns>
        [HttpGet]
        [AjaxOnly]
        public ActionResult GetEnginePropById(string ProjectId, string EngineDataID)
        {
            var data = ec_enginedata_propertyIBLL.GetEnginePropById(ProjectId, EngineDataID);
            return Success(data);
        }
        #endregion

        #region 提交数据

        /// <summary>
        /// 保存工程数据属性表数据（新增）
        /// <summary>
        /// <returns></returns>
        [HttpPost]
        [AjaxOnly]
        public ActionResult SaveEngineProp(string ProjectId, string strEntity)
        {
            List<ec_enginedata_propertyEntity> entityList = strEntity.ToList<ec_enginedata_propertyEntity>();
            ec_enginedata_propertyIBLL.SaveEngineProp(ProjectId, entityList);
            return Success("保存成功！");
        }
        #endregion

    }
}
